<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@page import="br.com.bean.NotaFaltaBimestreBean"%>
<%@page import="br.com.controller.NotaFaltaBimestralController"%>
<%@page import="br.com.bean.EnsinoBean"%>
<%@page import="br.com.bean.TurnoBean"%>
<%@page import="br.com.bean.BimestreBean"%>
<%@page import="br.com.controller.TurnoController"%>
<%@page import="br.com.controller.EnsinoController"%>
<%@page import="br.com.controller.BimestreController"%>
<%@page import="br.com.connection.ConnectionFactory"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.util.List"%>

<% Connection conn = new ConnectionFactory().getConnection();%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>Notas e Faltas</title>

<!-- Css -->
<link rel="stylesheet" type="text/css" href="Css/css.css" />

<!-- Script -->
<script type='text/javascript' src='Script/ajax.js'></script>
<script type='text/javascript' src='Script/mascaras.js'></script>
</head>

<body>

	<div id="html">

		<h2>Cadastro de Notas e Faltas</h2>
		<table>
			<tr>
				<th>Tipo de nota:</th>
				<td><select id="combobox" name="combobox"
					onchange="javascript:showDiv(this.value);">
						<option value="">Selecione</option>
						<option value="bimestral">Nota Bimestral</option>
						<option value="recuperacao">Nota Recuperação</option>
						<option value="exame">Nota Exame</option>
				</select></td>
			</tr>
		</table>

		<div id="bimestral" class="invisivel">

			<form method="post" name="fmr" action="CadNotaFaltaServlet">

				<h2>Nota Bimestral</h2>
				<table>
					<tr>
						<th>Bimestre:</th>
						<td><select name="bimestre">
							<option value="0">Selecione</option>
							<%List<BimestreBean> bimestre = BimestreController.ListBimestre(conn);
							for (BimestreBean b : bimestre) {
							%>
							<option value="<%=b.getId()%>"><%=b.getBimestre()%></option>
							<%}%>
						</select></td>
					</tr>
					<tr>
						<th>Turno:</th>
						<td><select name="turno" onchange="MandaID(this.value, 'ensino.jsp', 'ensino');">
							<option value="0">Selecione</option>
							<%List<TurnoBean> turno = TurnoController.ListTurno(conn);
							for(TurnoBean t : turno){
							%>
							<option value="<%=t.getId()%>"><%=t.getDescricao()%></option>
							<%}%>
						</select></td>
					</tr>
					<tr>
						<th>Ensino:</th>
						<td><select name="ensino" id="ensino" onchange="MandaID(this.value, 'serie.jsp', 'serie');" >
							<option value="0">Selecione</option>		
						</select></td>
					</tr>
					<tr>
						<th>Série:</th>
						<td><select class="serie" id="serie" onchange="MandaID(this.value, 'turma.jsp', 'turma')">
							<option value="0">Selecione</option>
						</select></td>
					</tr>
					<tr>
						<th>Turma:</th>
						<td><select name="turma" id="turma"	onchange="MandaID(this.value, 'disciplina.jsp', 'disciplina')"
						 onblur="MandaID(this.value, 'canhotoNota.jsp', 'canhoto')">
						<option value="0">Selecione</option>
						</select></td>
					</tr>
					<tr>
						<th>Diciplina:</th>
						<td><select name="disciplina" id="disciplina">
							<option value="0">Selecione</option>
						</select></td>
					</tr>
					<tr>
						<th>Aulas Dadas:</th>
						<td><input type="text" name="auladadas" id="auladadas" maxlength="4" /></td>
					</tr>
				</table>
				
				<div id="canhoto"></div>
	
		<input type="submit" name="finalizar" id="finalizar" value="Finalizar" /> 
				<input type="reset" name="cancelar"	id="cancelar" value="Cancelar" />
				
			</form>
		</div>

		<div id="recuperacao" class="invisivel">

			<h2>Nota Recuperação</h2>
			<table>
				<tr>
					<th>Ano letivo:</th>
					<td><input type="text" name="anoletivo" id="anoletivo"
						size="10" maxlength="4" /></td>
				</tr>
				<tr>
					<th>Recuperação:</th>
					<td><select>
							<option value="0">Selecione</option>
					</select></td>
				</tr>
				<tr>
					<th>Bimestre:</th>
					<td><select>
							<option value="0">Selecione</option>
					</select></td>
				</tr>
				<tr>
					<th>Ensino:</th>
					<td><select>
							<option value="0">Selecione</option>
					</select></td>
				</tr>
				<tr>
					<th>Série:</th>
					<td><select>
							<option value="0">Selecione</option>
					</select></td>
				</tr>
				<tr>
					<th>Turno:</th>
					<td><select>
							<option value="0">Selecione</option>
					</select></td>
				</tr>
				<tr>
					<th>Turma:</th>
					<td><select>
							<option value="0">Selecione</option>
					</select></td>
				</tr>
			</table>
			<div id="canhoto">
				<table>
				<tr>
					<th>Diciplina:</th>
					<td><select name="disciplina" id="disciplina">
							<option value="0">Selecione</option>
					</select></td>
				</tr>
					<tr>
						<th>ALUNO</th>
						<th>NOTA</th>
						<th>FALTA</th>
					</tr>
				</table>

			</div>

			<input type="submit" name="finalizar" id="finalizar" value="Finalizar" />
			<input type="reset" name="cancelar" id="cancelar" value="Cancelar" />

		</div>

		<div id="exame" class="invisivel">

			<h2>Nota Exame</h2>
			<table>
				<tr>
					<th>Ano letivo:</th>
					<td><input type="text" name="anoletivo" id="anoletivo"
						size="10" maxlength="4" /></td>
				</tr>
				<tr>
					<th>Ensino:</th>
					<td><select>
							<option value="0">Selecione</option>
					</select></td>
				</tr>
				<tr>
					<th>Série:</th>
					<td><select>
							<option value="0">Selecione</option>
					</select></td>
				</tr>
				<tr>
					<th>Turno:</th>
					<td><select>
							<option value="0">Selecione</option>
					</select></td>
				</tr>
				<tr>
					<th>Turma:</th>
					<td><select>
							<option value="0">Selecione</option>
					</select></td>
				</tr>
				<tr>
					<th>Diciplina:</th>
					<td><select>
							<option value="0">Selecione</option>
					</select></td>
				</tr>
			</table>

			<div id="canhoto">

				<table>
					<tr>
						<th>ALUNO</th>
						<th>NOTA</th>
						<th>FALTA</th>
					</tr>
					<tr>
						<td></td>
						<td><input type="text" name="nota" id="nota" size="5"
							maxlength="5" /></td>
						<td><input type="text" name="falta" id="falta" size="5"
							maxlength="5" /></td>
					</tr>
				</table>

			</div>

			<input type="submit" name="finalizar" id="finalizar" value="Finalizar" />
			<input type="reset" name="cancelar" id="cancelar" value="Cancelar" />

		</div>

	</div>
<body>
</html>